home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple Reference & Presen…rary 5 (Internal Edition)
/
Apple R&P Lib Internal v5.0.iso
/
6-Developer Demos
/
Developer Demos-Gen.
/
America Online Demo
/
Online Files
/
Online CCL
/
Online CCL.rsrc
/
AOcl_501_Tymnet
< prev
next >
Wrap
Text File
|
1989-09-25
|
8KB
|
310 lines
! -----------------------------------------------------
! TYMNET.ALCL
! By: David Steinberg
! Tymnet: 691 - 8200 (1200 baud)
! 352 - 3136 (2400 baud)
!
! Date: June 20, 1989
! Rev: 5.00
!Changed 6/21/89 by DMC: Assume "CONNECT" means 1200 baud.
!Changed 7/27/89 by DMC To give new busy message when line is busy
!Changed 9/14/89 by DMC To set modem to extended command set
!Changed 9/19/89 to report error codes.
!----------------------------------------------------------------------
!
! Connect Sequence:
!
-LABEL 0
Revision 5
DsplyMsg Initializing modem.
CanBtn 25 { if cancel button - just exit }
SetTries 0
ChrDelay 2
SerReset ~BAUD 0 8 1
HSReset 0 0 17 19
DsplyPic 1
!
!----------------------------------------------------------------------
!
-LABEL 1 { wake up the modem }
Flush
!
MatchStr 1 2 +++ { In case we match dont wait for the full time}
MatchStr 2 2 OK
MatchStr 3 2 > { Special case for Avatex 1200 modems}
Xmit +++ { Get the modems attention}
Wait 200 { Pause for 2 seconds, minimum gap required}
!
-Label 2
MatchStr 1 3 OK
MatchStr 2 33 NO { Cant hangup}
MatchStr 3 33 ERROR { Command error}
MatchStr 4 3 > { Special case for Avatex 1200 modems}
!
Pause 40 { Allow modem to settle a bit.}
Xmit AT Z\13
! { jump to label #3 if we see 'OK' go by }
Wait 200 { wait for 'OK' from modem - fall thru if timeout }
!
Jump 33 { Exit stage left....modem timed out. }
!
!---------------------------------------------------------------------
!
-LABEL 3 { just saw 'OK'-Set modem to x1 }
!
MatchStr 1 4 OK
MatchStr 2 4 ERROR {We don't care what we get for this one}
!
Pause 40 { Allow modem to settle between commands.}
Xmit ATE1Q0X1\13
!
!---------------------------------------------------------------------
-LABEL 4 { Now try to dial }
DsplyMsg Dialing ~FONE
!
!Changed 6/21/89 by DMC: Assume "CONNECT" means 1200 baud.
MatchStr 1 6 CONNECT\13
MatchStr 2 5 CONNECT 300
MatchStr 3 6 CONNECT 1200
MatchStr 4 11 CONNECT 2400 {If there using an MNP modem at dial at say 9600 and connect}
MatchStr 5 11 CONNECT 4800 {at 1200/300 then there screwed for now.}
MatchStr 6 11 CONNECT 9600
MatchStr 5 33 NO DIAL
MatchStr 6 27 NO ANSWER
MatchStr 7 33 VOICE
MatchStr 8 33 CARRIER
MatchStr 9 26 BUSY
MatchStr 10 33 ERROR
!
SetTries 0
CanBtn 24 { if cancel button hit, hangUp then exit }
Pause 30
Xmit AT~MSTR D~TONE~FONE\13
! { jump to label #13 if match }
Wait 2400 { wait 30 seconds for CONNECT msg from modem }
!
!
MatchStr 1 7 2400 {We'll couldn't match, But maybe were using an MNP modem.}
MatchStr 2 8 4800 {We could encounter some confusion with number dialed here.}
MatchStr 3 9 9600 {Dont check for 300,1200 due to this confusion.}
! {Plus MNP modems may talk at a higher baud rate then there connect at.}
!
Wait 30
Jump 27 { else hang up phone & exit }
!
!
!----------------------------------------------------------------------
!
-Label 5
SerReset 300 0 8 1
Pause 20
FLUSH
Jump 11
!
!
-Label 6
SerReset 1200 0 8 1
Pause 20
FLUSH
Jump 11
!
!
-Label 7
SerReset 2400 0 8 1
Pause 20
FLUSH
Jump 11
!
-Label 8
SerReset 4800 0 8 1
Pause 20
FLUSH
Jump 11
!
-Label 9
SerReset 9600 0 8 1
Pause 20
FLUSH
Jump 11
!
!
!
!----------------------------------------------------------------------
!----------------------------------------------------------------------
!
-LABEL 11 { Modem just sent 'CONNECT' message }
DsplyPic 2
Pause 600 {Give a second for line to settle on host side }
!
-Label 12
SetTries 0
!
-LABEL 13
! { Establishing Connection }
MatchStr 1 14 LOG IN:
MatchStr 2 12 IDENTIFIER {Still looking for 'A' but were aokay.}
MatchStr 3 27 ABORTED
MatchStr 4 27 HOST NOT
MatchStr 5 16 ERROR { Maybe connected thru alaska-net, do it the old way.}
MatchStr 6 27 BAD
!
Flush
Xmit A
Wait 900
IncTries
IfTries 4 27
Jump 13
!
-Label 14
MatchStr 1 15 +
MatchStr 2 34 PASSWORD: {Didnt accept our Login;Password string.}
MatchStr 3 16 ERROR
Xmit ~TYM1;~TYM2\13
Wait 3600
Jump 27
!
-Label 15
MatchStr 1 23 CALL CONNECTED
Xmit ~TYM3\13
Wait 3600
Jump 27
!
!
!
-Label 16 {Try tymnets old way of connecting.}
SetTries 0
!
-Label 17
MatchStr 1 18 PASSWORD:
MatchStr 2 27 ERROR
MatchStr 3 17 LOG IN:
Xmit ~TYM1\13
Wait 3600
IncTries
IfTries 4 27
Jump 17
!
-Label 18
MatchStr 1 15 +
MatchStr 2 17 LOG IN:
MatchStr 3 27 ERROR
MatchStr 4 18 PASSWORD:
Xmit ~TYM2\13
Wait 3600
IncTries
IfTries 4 27
Jump 18
!
!
-Label 23
Exit 0
!
!----------------------------------------------------------------------
!
-Label 24 {User aborted connect sequence}
Hangup
Exit -111
!
-Label 25 {User aborted but we dont need to hang up.
Exit -1
!----------------------------------------------------------------------
!
-Label 26 {Busy phone}
Talert All phone lines are currently busy. \13Please wait a few minutes and try again.\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 27 {No Answer}
Talert There is no answer from the access company (Error # 3).\13Verify the access number and try again.\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 28 {Noisy line}
Talert There is noise on your phone line (Error # 16).\13Please try again.\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 29 {acct bad}
Talert Unable to verify account information (Error # 22).\13\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 30 {disk problem}
Talert There was an error in reading your ~APPL disk (Error # 0).Please try again.\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 31 {acct aleady on}
Talert Please wait a few minutes and try again (Error # 23).\13\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 32 {not_avail}
Talert ~APPL is not available at the moment (Error # 20).\13Please wait a few minutes and try again.\13\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 33 {generic}
Talert Unable to initialize modem (Error # 1). Please take the following steps:\13\13 1) Turn your modem off, then back on.\13 2) Verify the access number.\13 3) Make sure that your modem and phone line are connected correctly.\13 4) Try again.
Jump 36
!
!----------------------------------------------------------------------
!
-Label 34 {db_error}
Talert There is a bad ~APPL file on your disk (Error # 0).\13\13
Jump 36
!
!----------------------------------------------------------------------
!
-Label 35
Exit -1
!
!----------------------------------------------------------------------
!
-Label 36
Alert 35 \13If the problem persists, call ~APPL customer service at ~ACUS.
Exit -1
!
!----------------------------------------------------------------------
!
*-Label 0 {Hangup Sequence}\
*ChrDelay 2
*CanBtn 2
!
*MatchStr 1 1 OK {Dont look for echo first time, it maybe}
*MatchStr 2 1 NO {a false echo. Any type of match is good}
*MatchStr 3 1 > { Special case for Avatex 1200 modems}
!
*Xmit +++ {Try and get the modems attention}
*Wait 210
!
*MatchStr 1 1 OK
*MatchStr 2 2 CARRIER {Any type of match is good}
*MatchStr 3 1 +++
*MatchStr 4 1 > { Special case for Avatex 1200 modems}
!
*Xmit +++ {Double our odds}
*Wait 210
!
*-Label 1
*MatchStr 1 2 ERROR
*MatchStr 2 2 OK
*MatchStr 3 2 CARRIER
*MatchStr 4 2 > { Special case for Avatex 1200 modems}
!
*Pause 40
*Xmit AT H\13
*Wait 300
!
*-Label 2
*Exit 0
!
###